<?php
/**
 * SocialEngine
 *
 * @category   Application_Extensions
 * @package    Page
 * @copyright  Copyright Hire-Experts LLC
 * @license    http://www.hire-experts.com
 * @version    $Id: Global.php 2010-08-31 16:05 idris $
 * @author     Idris
 */

/**
 * @category   Application_Extensions
 * @package    Page
 * @copyright  Copyright Hire-Experts LLC
 * @license    http://www.hire-experts.com
 */

class Page_Form_Admin_Global extends Engine_Form
{
  public function init()
  {
    $this
      ->setTitle('Page Global Settings')
      ->setDescription('PAGE_FORM_ADMIN_GLOBAL_DESCRIPTION');

    $settings = Engine_Api::_()->getApi('settings', 'core');
    
    $this->addElement('Text', 'gmap_key', array(
      'label' => 'Google Map Key',
      'description' => 'PAGE_SETTING_GMAPKEY_DESC',
      'value' => $settings->getSetting('page.gmapkey', ''),
      'size' => 60
    ));
    
    $this->getElement('gmap_key')->getDecorator('Description')->setOption('escape', false);
    
    $this->addElement('Text', 'browse_page_count', array(
      'label' => 'Item Count on Browse Page',
      'description' => 'PAGE_SETTING_BROWSE_COUNT',
      'value' => $settings->getSetting('page.browse_count', 10)
    ));
    
    $this->addElement('Text', 'recent_page_count', array(
      'label' => 'Recent Pages Count',
      'description' => 'PAGE_SETTING_RECENT_COUNT',
      'value' => $settings->getSetting('page.recent_count', 6)
    ));
    
    $this->addElement('Text', 'popular_page_count', array(
      'label' => 'Popular Pages Count',
      'description' => 'PAGE_SETTING_POPULAR_COUNT',
      'value' => $settings->getSetting('page.popular_count', 6)
    ));
    
    $this->addElement('Text', 'featured_page_count', array(
      'label' => 'Featured Pages Count',
      'description' => 'PAGE_SETTING_FEATURED_COUNT',
      'value' => $settings->getSetting('page.featured_count', 6)
    ));

    $this->addElement('Checkbox', 'approval', array(
      'label' => 'PAGE_SETTING_APPROVAL',
      'description' => 'New Pages Approval',
      'value' => $settings->getSetting('page.approval', 1)
    ));
    
    $this->addElement('Button', 'submit', array(
      'label' => 'Save Changes',
      'type' => 'submit',
      'ignore' => true
    ));
  }
}